package Model;

import java.sql.Time;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * User: Женя
 * Date: 03.11.13
 * Time: 19:19
 * To change this template use File | Settings | File Templates.
 */
public class Order {

    private int id;
    private Client client;
    private Staff staff;
    private Double money;
    private Time timeOfOrder;
    private Date date;
    private Props props;
    private Time durationOfProgram;
    private String venue;
    private Double averageAgeOfChildren;

    public Order() {
    }

    public Order(int id, Client client, Staff staff, Double money, Time timeOfOrder, Date date, Props props, Time durationOfProgram, String venue, Double averageAgeOfChildren) {
        this.id = id;
        this.client = client;
        this.staff = staff;
        this.money = money;
        this.timeOfOrder = timeOfOrder;
        this.date = date;
        this.props = props;
        this.durationOfProgram = durationOfProgram;
        this.venue = venue;
        this.averageAgeOfChildren = averageAgeOfChildren;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Client getClient() {
        return client;
    }

    public void setClient(Client client) {
        this.client = client;
    }

    public Staff getStaff() {
        return staff;
    }

    public void setStaff(Staff staff) {
        this.staff = staff;
    }

    public Double getMoney() {
        return money;
    }

    public void setMoney(Double money) {
        this.money = money;
    }

    public Time getTimeOfOrder() {
        return timeOfOrder;
    }

    public void setTimeOfOrder(Time timeOfOrder) {
        this.timeOfOrder = timeOfOrder;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public Props getProps() {
        return props;
    }

    public void setProps(Props props) {
        this.props = props;
    }

    public Time getDurationOfProgram() {
        return durationOfProgram;
    }

    public void setDurationOfProgram(Time durationOfProgram) {
        this.durationOfProgram = durationOfProgram;
    }

    public String getVenue() {
        return venue;
    }

    public void setVenue(String venue) {
        this.venue = venue;
    }

    public Double getAverageAgeOfChildren() {
        return averageAgeOfChildren;
    }

    public void setAverageAgeOfChildren(Double averageAgeOfChildren) {
        this.averageAgeOfChildren = averageAgeOfChildren;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Order order = (Order) o;

        if (id != order.id) return false;
        if (client != null ? !client.equals(order.client) : order.client != null) return false;
        if (date != null ? !date.equals(order.date) : order.date != null) return false;
        if (timeOfOrder != null ? !timeOfOrder.equals(order.timeOfOrder) : order.timeOfOrder != null) return false;
        if (venue != null ? !venue.equals(order.venue) : order.venue != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (client != null ? client.hashCode() : 0);
        result = 31 * result + (timeOfOrder != null ? timeOfOrder.hashCode() : 0);
        result = 31 * result + (date != null ? date.hashCode() : 0);
        result = 31 * result + (venue != null ? venue.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "Order{" +
                "id=" + id +
                ", client=" + client +
                ", staff=" + staff +
                ", money=" + money +
                ", timeOfOrder=" + timeOfOrder +
                ", date=" + date +
                ", props=" + props +
                ", durationOfProgram=" + durationOfProgram +
                ", venue='" + venue + '\'' +
                ", averageAgeOfChildren=" + averageAgeOfChildren +
                '}';
    }
}
